package com.cs.common.init;

import java.util.HashMap;

import com.cs.common.init.beans.SystemParameterBean;

/**
 * Sysmte Parameters collection
 * @version 1.0 
 * @date  2008-10-19
 * @author jdelgado
 */

public class SystemParameterCollection extends HashMap implements IInit {
	/** Serialization UID */
	private static final long serialVersionUID = -2973612598042871417L;
	/** Class instance */
	private static SystemParameterCollection parameterCollection = null;
	/**
	 * Gets class instance filled
	 */
	public static SystemParameterCollection getInstance(){
		return parameterCollection;
	}
	/**
	 * Loads the xml file into class
	 * @param object Object to load
	 */
	public void init(Object object) {
		if( object != null ){
			if( object instanceof SystemParameterCollection){
				parameterCollection = (SystemParameterCollection) object;
			}
		}
	}
	/**
	 * Add PhonesTypeBean to the collection
	 * @param phonesTypeBean
	 */
	public void addSystemParameterBean( SystemParameterBean systemParameterBean ){
		this.put(systemParameterBean.getCode(), systemParameterBean);
	}
	/**
	 * Gets parameter bean
	 * @param code Parameter code
	 * @return SystemParameterBean
	 */
	public SystemParameterBean getSystemParameterBean(String code){
		SystemParameterBean systemParameterBean = null;
		systemParameterBean = (SystemParameterBean)this.get(code);
		return systemParameterBean;
	}
}